home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / modem / ezdia175.zip / DIALUNIT.PAS < prev    next >
Pascal/Delphi Source File  |  1996-02-21  |  16KB  |  398 lines

  1. unit dialunit;
  2.  
  3. interface
  4. uses wintypes;
  5.  
  6. procedure StartSession(CmdLine:pchar;ParWindow:hwnd);
  7. (*
  8. Used by an application to initiate a standard script-based EZDialup session.
  9. The CMDLINE parameter is identical to the command-line parameter described
  10. in the manule and contians the complete path of an .INI file and a .EZD file.
  11. Optionally can begin with the complete path of the executable itself to
  12. ensure the executable is found.
  13. *)
  14.  
  15. Procedure AbortSession;
  16. (*
  17. Used by an application to have EZDialup immediately hangup and shutdown. 
  18. *)
  19.  
  20. Procedure ChangePhoneNumber;
  21. (*
  22. Used by an application to have EZDialup immediately hangup, shutdown, and
  23. prompt user for a new dialing sequence.  When user supplies new sequence the
  24. call is begun again. 
  25. *)
  26.  
  27. Procedure StopEZDialup(ParWindow:hwnd);
  28. (*
  29. Used by an application to have EZDialup remove itself from memory
  30. immediately.  Obsolete, but present for backward compatibility.
  31. *)
  32.  
  33. (*
  34. The following procedures and functions are used only by applications using
  35. EZDialup to link and remain connected.  The next 11 (SetParentWindow through
  36. SetExecutablePath) procedures must be called before any other commands.
  37. *)
  38.  
  39. procedure SetParentWindow(ParWindow:hwnd);
  40. (*
  41. Lets EZDialup know where to send status messages.  Execute this procedure
  42. as soon as you app begins - doing so means that if your app terminates
  43. during a connection it can restart and automatically re-attach to EZDialup.
  44. *)
  45.  
  46. procedure SetDialingSequence(DialStr:pchar);
  47. (*
  48. Sets the dialing sequence EZDialup will use to dial the server.  This
  49. must include any required prefix digits and/or pauses.                 
  50. *)
  51.  
  52. procedure SetDialupCommPort(PortStr:pchar); 
  53. (*
  54. Set the COMM port to use.  This should look like 'COM1', 'COM2', etc.
  55. *)
  56.  
  57. procedure SetDialupCommConfig(CfgStr:pchar); 
  58. (*
  59. Sets the actual string passed to Windows to initialize the
  60. communications port - "19200,n,8,1" is a typical example.  
  61. *)
  62.  
  63. procedure SetModemInit1(InitStr:pchar); 
  64. (*
  65. Sets the first initialization string sent to the modem, usually "ATZ" or
  66. "AT&F"
  67. *)
  68.  
  69. procedure SetModemInit2(InitStr:pchar); 
  70. (*
  71. Sets the second initialization string sent to the modem.  A typical example
  72. is "AT E0 V1 S0=0 X4"...
  73.  
  74. AT simply starts the command.
  75.  
  76. E0 asks the modem not to repeat every command back to the computer.
  77.  
  78. V1 asks modem to report situations with phrases (e.g. "CONNECT 14400").
  79.  
  80. X4 asks modem to report statuses with all available detail.
  81.  
  82. These are the minimal settings.  Additional data-compression codes may be
  83. added if desired.
  84. *)
  85.  
  86.  
  87. Procedure SetDownloadBlockSize(Size:integer);      
  88. (*
  89. Used to set the size of data blocks during downloads.  Maximum value
  90. is 4096. 
  91. *)
  92.  
  93. Procedure SetUploadBlockSize(Size:integer);
  94. (*
  95. Used to set the size of data blocks during upoads.  Maximium value
  96. is 4096. 
  97. *)
  98.  
  99. procedure SetLinkUserPath(path:pchar);
  100. (*
  101. Used to set the path on the server that contains the password file (COMMPASS)
  102. for the given user.
  103. *)
  104.  
  105. procedure SetLinkUserPassword(password:pchar);
  106. (*
  107. Used to set the password EZDialup will use to log in to the server.
  108. *)
  109.  
  110. procedure SetExecutablePath(path:pchar); 
  111. (*
  112. Used to set the complete path of the executable usually named EZDIALUP.EXE,
  113. though you may give the file any other name with an .EXE extension and
  114. specify the new name with this function
  115. *)
  116.  
  117. procedure EstablishDialupLink;
  118. (*
  119. Used by an application to dial a server immediately.  Not needed, because
  120. all the following commands will establish the link automatically if one does
  121. not already exist.
  122. *)
  123.  
  124. (*
  125. The following functions have a few things in common:
  126.  
  127. 1) Will establish link automatically if one does not already exist.
  128. 2) Returns the command's serial number.  Your app should store this.
  129. 3) Your application will receive a message at WMUSER+151 when the command
  130. is finished.  The 16-bit wparam portion of the message will contain the
  131. serial number of command completed, and the 32-bit lparam portion of
  132. the message is a pointer to a null-terminated string that describes
  133. the completion status.  If the string reads "No Errors" then, of course, no
  134. problem occurred during command execution.  Otherwise, the string describes
  135. the problem.
  136. *)
  137.  
  138. function StartDownload(ServerSource,ClientTarget:pchar):word;
  139. (*
  140. Used to have EZDialup start transferring a file from the server to the
  141. client.  Returns the command's serial number.
  142. *)
  143.  
  144. function StartUpload(ClientSource,ServerTarget:pchar):word;
  145. (*
  146. Used to have EZDialup start transferring a file from the client to the
  147. server.  Returns the command's serial number.
  148. *)
  149.  
  150. function StartMoveDown(ServerSource,ClientTarget:pchar):word;
  151. (*
  152. Used to have EZDialup start transferring a file from the server to the
  153. client.  This move is stopped if client finds a file already exists with
  154. the name in the ClientTarget parameter, or if the server can not find a
  155. file with the name in the ServerSource parameter.  If the transfer to the
  156. client is successful, the file on the server is removed.  Returns the
  157. command's serial number.
  158. *)
  159.  
  160. function StartMoveUp(ClientSource,ServerTarget:pchar):word;
  161. (*
  162. Used to have EZDialup start transferring a file from the client to the
  163. server.  This move is stopped if server finds a file already exists with
  164. the name in the ServerTarget parameter, or if the client can not find a
  165. file with the name in the ClientSource parameter.  If the transfer to the
  166. server is successful, the file on the client is removed.  Returns the
  167. command's serial number.
  168. *)
  169.  
  170. function UnzipServerFile(ZipFilePath,TargetServerDirectory:pchar):word;
  171. (*
  172. Used to Un-zip the files stored in the server file listed in the ZipFilePath
  173. parameter into the directory specified in the TargetServerDirectory
  174. parameter.  Files are overwritten if already there.  Returns the command's
  175. serial number.  If the Target directory does not exist it will be created
  176. before the unzip.  All zip functions are 2.04g-compatible.
  177. *)
  178.  
  179. function UnzipClientFile(ZipFilePath,TargetClientDirectory:pchar):word;
  180. (*
  181. Used to Un-zip the files stored in the client file listed in the ZipFilePath
  182. parameter into the directory specified in the TargetClientDirectory
  183. parameter.  Files are overwritten if already there.  Returns the command's
  184. serial number.  If the Target directory does not exist it will be created
  185. before the unzip.  All zip functions are 2.04g-compatible.
  186. *)
  187.  
  188. function ZipServerFile(TargetZipFile,SourcePathAndFileMask:pchar):word;
  189. (*
  190. Used to add to a server .ZIP file (listed in the TargetZipFile parameter)
  191. the files that match the path/wildcard in SourcePathAndFileMask parameter.
  192. The file is not overwritten if already there - use the DeleteFilesOnServer
  193. command to start a new one.  If the file is already in the .ZIP file, and
  194. the date/time stamp is the same, the file is not added again; but if the
  195. file is newer it will replace the older version.  Returns the command's
  196. serial number.  All zip functions are 2.04g-compatible.
  197. *)
  198.  
  199. function ZipClientFile(TargetZipFile,SourcePathAndFileMask:pchar):word;
  200. (*
  201. Used to add to a client .ZIP file (listed in the TargetZipFile parameter)
  202. the files that match the path/wildcard in SourcePathAndFileMask parameter.
  203. The file is not overwritten if already there - use the DeleteFilesOnClient
  204. command to start a new one.  If the file is already in the .ZIP file, and
  205. the date/time stamp is the same, the file is not added again; but if the
  206. file is newer it will replace the older version.  Returns the command's
  207. serial number.  All zip functions are 2.04g-compatible.
  208. *)
  209.  
  210. function DeleteFilesOnServer(SourcePathAndFileMask:pchar):word;
  211. (* 
  212. Used to delete the files on the server that match the path/wildcard, and
  213. can erase a single file or, using the asterisk wild-card symbol, a group
  214. of files.  Returns the command's serial number.
  215. *)
  216.  
  217. function DeleteFilesOnClient(SourcePathAndFileMask:pchar):word;
  218. (*
  219. Used to delete the files on the client that match the path/wildcard, and
  220. can erase a single file or, using the asterisk wild-card symbol, a group
  221. of files.  Returns the command's serial number.
  222. *)
  223.  
  224. function RunProgramOnServer(ProgramPath:pchar):word;
  225. (*
  226. Used to run a program on the server.  No furthur commands will be
  227. executed until this program terminates- use LaunchProgramOnServer
  228. to allow command-processing to continue.  
  229.  
  230. Command line parameters can be included.
  231.  
  232. Returns the command's serial number.
  233. *)
  234.  
  235. function RunProgramOnClient(ProgramPath:pchar):word;
  236. (*
  237. Used to run a program on the client.  No furthur commands will be
  238. executed this program terminates - use LaunchProgramOnClient to allow
  239. command-processing to continue.
  240.  
  241. Command line parameters can be included.
  242.  
  243. Returns the command's serial number.
  244. *)
  245.  
  246. function LaunchProgramOnServer(ProgramPath:pchar):word;
  247. (*
  248. Used to run a program on the server.  The program is then ignored, and
  249. additional commands can be executed immediately - use RunProgramOnServer
  250. to require that program terminates before additonal commands can be
  251. processed.
  252.  
  253. Command line parameters can be included.
  254.  
  255. Returns the command's serial number.
  256. *)
  257.  
  258. function LaunchProgramOnClient(ProgramPath:pchar):word;
  259. (*
  260. Used to run a program on the client.  The program is then ignored, and
  261. additional commands can be executed immediately - use RunProgramOnClient
  262. to require that program terminates before additonal commands can be
  263. processed.
  264.  
  265. Command line parameters can be included.
  266.  
  267. Returns the command's serial number.
  268. *)
  269.  
  270. function UpdateClientDirectory(ClientDirectory,
  271.                                 ServerDirectory,
  272.                                 ClientDateFilePath:pchar):word;
  273. (*
  274. This is a specialized function used to "freshen" (bring up-to-date) an
  275. entire directory structure on a remote PC.  It looks in the server-side
  276. directory (ServerDir) for files newer than the client-side file
  277. (ClientCompareFile).  Sub-directories are included in this search.
  278.  
  279.  
  280. All newer files are zipped, then downloaded to the client.  The zip file
  281. is unzipped into the client-side directory (ClientDir), keeping the
  282. directory structure intact.
  283.  
  284. To use this function, copy an entire directory structure from the
  285. server side to a client.  As files on the server side change and new
  286. files are created, the time-and-date (T.A.D.) stamps for these files
  287. will be updated.
  288.  
  289. When the client calls in for an update, EZDialup can take the T.A.D.
  290. stamp of a selected file (let's call it the "time" file, essentially
  291. the "new-ness" of the client-side data), gather all server files that
  292. are newer, then transfer them to the appropriate directories on the
  293. client PC.
  294.  
  295. One of these newer files will be the server version of the "time" file,
  296. \so the client-side "time" file will have a new time-and-date stamp.
  297. If the user were to immediately update again, the server side would
  298. find no files newer and issue an "Up to date" message to the client.
  299.  
  300. To make this work, the time-and-date stamp of the control file on the
  301. server must be given a new T.A.D. stamp every time the a file in the
  302. directory structure is changed or created.  The only downside to
  303. overlooking this rule is that the client-side software would not
  304. realize how "new" and up-to-date it is the next time it calls and
  305. might end up retrieving some files unnecessarily.
  306.  
  307. Note that we've specified that changing or creating files will result
  308. is new time-and-date stamps.  If you copy an existing file into the
  309. structure, the T.A.D. will be the same as the original, which might not
  310. be newer than the "time" file.
  311. *)
  312.  
  313. function  EZMailUpdate(ServerMailboxPath,
  314.                        ClientMailDirectory:pchar):word;
  315. (*
  316. Used to perform a mail update.  Works only with EZ Software's EZMail.
  317. The first parameter (ServerMailboxPath) is the location and name of
  318. the user's mailbox on the server side.  The second parameter
  319. (ClientMailDirectory) is the location of EZMail on the user's remote PC.
  320. *)
  321.  
  322. procedure EstablishLinkAsTerminal;
  323. (*
  324. Used by an application to dial a BBS.
  325. *)
  326.  
  327.  
  328. Function SerialIOWaiting:boolean;
  329. Function GetSerialByte:integer;
  330. function SendSerialByte(SendByte:byte):boolean;
  331. function SendSerialString(Sendstr:pchar):boolean;
  332. function SetupNotification(SearchStr,ResponseStr:pchar;Index,Message:word):word;
  333. procedure DisableAllNotifications;          
  334. procedure ReEnableAllNotifications; 
  335. procedure StartTerminalDownload(LocalFilePath:pchar;ProtocolCode:integer);
  336. procedure StartTerminalUpload(LocalFilePath:pchar;ProtocolCode:integer);
  337. procedure InterruptFileTransfer;
  338. procedure EstablishCommPortLink;        
  339. procedure SupplyRegistrationCodes(Code1,Code2:pchar);
  340.  
  341. implementation
  342.  
  343. procedure StartSession;                 EXTERNAL 'APPDIAL'  index 1;
  344. procedure AbortSession;                 EXTERNAL 'APPDIAL'  index 2;
  345. Procedure ChangePhoneNumber;            EXTERNAL 'APPDIAL'  index 3;
  346. Procedure StopEZDialup;                 EXTERNAL 'APPDIAL'  index 4;
  347.  
  348. Procedure SetParentWindow;            EXTERNAL 'APPDIAL'  index 5;
  349. Procedure SetDialingSequence;         EXTERNAL 'APPDIAL'  index 6;
  350. Procedure SetDialupCommPort;          EXTERNAL 'APPDIAL'  index 7;
  351. Procedure SetDialupCommConfig;        EXTERNAL 'APPDIAL'  index 8;
  352. Procedure SetModemInit1;              EXTERNAL 'APPDIAL'  index 9;
  353. Procedure SetModemInit2;              EXTERNAL 'APPDIAL'  index 10;
  354. Procedure SetDownloadBlockSize;       EXTERNAL 'APPDIAL'  index 11;
  355. Procedure SetUploadBlockSize;         EXTERNAL 'APPDIAL'  index 12;
  356. procedure SetLinkUserPath;            EXTERNAL 'APPDIAL'  index 13;
  357. procedure SetLinkUserPassword;        EXTERNAL 'APPDIAL'  index 14;
  358. procedure SetExecutablePath;          EXTERNAL 'APPDIAL'  index 15;
  359. procedure EstablishDialupLink;        EXTERNAL 'APPDIAL'  index 16;
  360.  
  361. function StartDownload;               EXTERNAL 'APPDIAL'  index 17;
  362. function StartUpload;                 EXTERNAL 'APPDIAL'  index 18;
  363. function StartMoveDown;               EXTERNAL 'APPDIAL'  index 19;
  364. function StartMoveUp;                 EXTERNAL 'APPDIAL'  index 20;
  365. function UnzipServerFile;             EXTERNAL 'APPDIAL'  index 21;
  366. function UnzipClientFile;             EXTERNAL 'APPDIAL'  index 22;
  367. function ZipServerFile;               EXTERNAL 'APPDIAL'  index 23;
  368. function ZipClientFile;               EXTERNAL 'APPDIAL'  index 24;
  369. function DeleteFilesOnServer;         EXTERNAL 'APPDIAL'  index 25;
  370. function DeleteFilesOnClient;         EXTERNAL 'APPDIAL'  index 26;
  371. function RunProgramOnServer;          EXTERNAL 'APPDIAL'  index 27;
  372. function RunProgramOnClient;          EXTERNAL 'APPDIAL'  index 28;
  373. function LaunchProgramOnServer;       EXTERNAL 'APPDIAL'  index 29;
  374. function LaunchProgramOnClient;       EXTERNAL 'APPDIAL'  index 30;
  375. function UpdateClientDirectory;       EXTERNAL 'APPDIAL'  index 31;
  376. function EZMailUpdate;                EXTERNAL 'APPDIAL'  index 32;
  377.                                        
  378. procedure EstablishLinkAsTerminal;    EXTERNAL 'APPDIAL'  index 33;      
  379. Function SerialIOWaiting;             EXTERNAL 'APPDIAL'  index 34;
  380. Function GetSerialByte;               EXTERNAL 'APPDIAL'  index 35;
  381. function SendSerialByte;              EXTERNAL 'APPDIAL'  index 36;         
  382. function SendSerialString;            EXTERNAL 'APPDIAL'  index 37;
  383. function SetupNotification;           EXTERNAL 'APPDIAL'  index 38;
  384. procedure DisableAllNotifications;    EXTERNAL 'APPDIAL'  index 39;
  385. procedure ReEnableAllNotifications;   EXTERNAL 'APPDIAL'  index 40;
  386. procedure StartTerminalDownload;        EXTERNAL 'APPDIAL'  index 41;
  387. procedure StartTerminalUpload;          EXTERNAL 'APPDIAL'  index 42;
  388. procedure InterruptFileTransfer;        EXTERNAL 'APPDIAL'  index 43;
  389. procedure EstablishCommPortLink;        EXTERNAL 'APPDIAL'  index 44;
  390. procedure SupplyRegistrationCodes;      EXTERNAL 'APPDIAL'  index 45;
  391.  
  392.  
  393.  
  394.  
  395. end.
  396.  
  397.  
  398.